﻿namespace Sai.Core
{
    using System.Linq;
	using Sai.Core.Rules;
	
	public class AssemblyIntrospectionWalkerFactory : IWalkIntrospectedAssembliesFactory
	{
		private IRulePluginRepository repository;

		public AssemblyIntrospectionWalkerFactory(IRulePluginRepository repo)
		{
			this.repository = repo;
		}

		public IWalkIntrospectedAssemblies Create()
		{
			IWalkIntrospectedAssemblies assemblyDifferenceWalker = new AssemblyIntrospectionWalker();

			assemblyDifferenceWalker.AddRange(this.repository.AssemblyRules);

			return assemblyDifferenceWalker;
		}
	}
}
